<?php

/**
 * Multas form base class.
 *
 * @method Multas getObject() Returns the current form's model object
 *
 * @package    sbweb3
 * @subpackage form
 * @author     Pablo Andrés Díaz
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseMultasForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idmulta'          => new sfWidgetFormInputHidden(),
      'no_cuenta'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Usuarios'), 'add_empty' => true)),
      'nombre'           => new sfWidgetFormTextarea(),
      'escuela'          => new sfWidgetFormInputText(),
      'fecha_devolucion' => new sfWidgetFormDateTime(),
      'monto'            => new sfWidgetFormInputText(),
      'observaciones'    => new sfWidgetFormTextarea(),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'idmulta'          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('idmulta')), 'empty_value' => $this->getObject()->get('idmulta'), 'required' => false)),
      'no_cuenta'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Usuarios'), 'required' => false)),
      'nombre'           => new sfValidatorString(array('required' => false)),
      'escuela'          => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'fecha_devolucion' => new sfValidatorDateTime(array('required' => false)),
      'monto'            => new sfValidatorInteger(array('required' => false)),
      'observaciones'    => new sfValidatorString(array('required' => false)),
      'created_at'       => new sfValidatorDateTime(),
      'updated_at'       => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('multas[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Multas';
  }

}
